// JavaScript Document
$(function(){
	$(".pageColumn table tbody tr").hover(function(){
		this.style.backgroundColor="#DDECF1";
	 }, function(){
		 this.style.backgroundColor="#FFFFFF";
	 });
	
	$(".TwoSide tr td:even").css({"text-align" : "right" , "font-weight" : "bolder" });
	$(".TwoSide tr td:odd").css({"text-align" : "left" , "padding-left" : "20px" });
    
	/**投票类别设置**/
	$(".vote_class").change(function(){
		var select_val = $(this).find("option:selected").val();
		if(select_val=="score_single"||select_val=="score_multi"){
			$(".score-tr").slideDown(0);
		}else{
			$(".score-tr").slideUp(0);
		}
		if(select_val=="vote_multi"||select_val=="score_multi"){
			$(".multi-tr").slideDown(0);
		}else{
			$(".multi-tr").slideUp(0);
		}
	});
	
	
	
	/**获取隐藏的名单**/
	$(".getlist").click(function(){
		ShowDIV(this.id);
	});
	
	/**隐藏名单**/
	$("#BgDiv").click(function(){
	  $("#BgDiv").css("display","none");
	  $(".showlist").css("display", "none");
	});
	
	
	
	
	
	Page();
	
	
});


function ShowDIV(thisObjID) {
          $("#BgDiv").css({ display: "block", height: $(document).height() });
          var yscroll = document.documentElement.scrollTop;
          $("#" + thisObjID + "_list" ).css("top", "100px");
          $("#" + thisObjID + "_list").css("display", "block");
		  if(thisObjID=="ip"){
			  $("#ip_list table").css("display","none");
			  switch($("#ip").attr("alt")){
				  case "permit":$("#ip_list .ip_permit_list").show();break;
				  case "ban":$("#ip_list .ip_ban_list").show();break;
			  }
		  }
          document.documentElement.scrollTop = 0;
 }

/**
function Page(){  //前端分页
   var firstPage = 0,lastPage = $(".tablePage tbody").size()-1;
   var prePage  =  0;
   var nextPage = lastPage?1:0;
   $(".tablePage tbody:gt(0)").css("display","none");
   $(".prePage").click(function(){
		$(".tablePage tbody").hide(0);
		$(".tablePage tbody:eq("+prePage+")").show();
		nextPage = prePage;
		prePage--;
		if(prePage<firstPage){
		   prePage = firstPage;
		   nextPage++;
		}
		
   });
   $(".nextPage").click(function(){
		$(".tablePage tbody").hide(0);
		$(".tablePage tbody:eq("+nextPage+")").show();
		prePage = nextPage;
		nextPage++;
		if(nextPage>lastPage){
		   nextPage = lastPage;
		   prePage--;
		}
   });
}
**/
 function Page(){  //前端分页
    
	$(".getlist").click(function(){
		window.firstPage = 0;
		window.lastPage  = $("#"+this.id+"_Page tbody").size()-1;
		window.prePage   =  0;
		window.nextPage  = lastPage?1:0;
		window.tablePage = "#"+this.id+"_Page tbody";
		$(window.tablePage+":gt(0)").css("display","none");
		$(window.tablePage+":eq(0)").show();
	});

   
   $(".prePage").click(function(){
		$(window.tablePage).hide(0);
		$(window.tablePage+":eq("+window.prePage+")").show();
		window.nextPage = window.prePage;
		window.prePage--;
		if(window.prePage<window.firstPage){
		   window.prePage = window.firstPage;
		   window.nextPage++;
		}
		
   });
   $(".nextPage").click(function(){
		$(window.tablePage).hide(0);
		$(window.tablePage+":eq("+window.nextPage+")").show();
		window.prePage = window.nextPage;
		window.nextPage++;
		if(window.nextPage>window.lastPage){
		   window.nextPage = window.lastPage;
		   window.prePage--;
		}
   });
}


